#ifndef __PUZZLE_H__
#define __PUZZLE_H__

#include <vector>
#include "tile.h"
using std::vector;

class Puzzle {
public:
	Puzzle(unsigned int size);
	~Puzzle();
	unsigned int getSize();
	vector<vector<Tile*> > getBoard();
	void newGame();
	void reset();
	bool move(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1);
	bool tileFits(unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1);
	bool isSolved();
	void print();
private:
	unsigned int size;
	unsigned int width;
	unsigned int halfWidth;
	unsigned int height;
	vector<vector<Tile*> > board;
	void buildGameBoard();
};

#endif
